#pragma once

#ifndef INC_02_SELECTION_SORT_H
#define INC_02_SELECTION_SORT_H

#include <iostream>
#include <algorithm>
#include "TestSortHelper.h"

using namespace std;

template <typename T>
void selectionSort(T arrays[], int lenarray) {

	for (int i = 0;i < lenarray;i++) {

		int minindex = i;
		for (int j = i + 1;j < lenarray;j++) {
			if (arrays[j] < arrays[minindex]) {
				minindex = j;
			}
		}
		swap(arrays[i], arrays[minindex]);
	}
}

#endif